<template>
	<view>
		<view class="smart-container"><text>组件</text></view>
		<view class="smart-panel-h"><navigator url="/pages/CustomPage/CustomPage" ><text>置顶新闻组件</text></navigator></view>
		<view class="smart-panel-h"><navigator url="/pages/newsPage/newsPage" ><text>新闻页</text></navigator></view>
		<view class="smart-panel-h"><navigator url="/pages/intentPage/intentPage" ><text>组件传值</text></navigator></view>
	</view>
	<view>
		<view class="smart-container">1.容器</view>
		<view class="smart-panel-h" @click="goDetailPage('viewpages')"><text>view视图</text></view>
		<view hidden="true" class="smart-panel-h" @click="goDetailPage('scroll-view')"><text>scroll-滚动视图</text></view>
		<view hidden="true" class=" smart-panel-h" @click="goDetailPage('swipter')"><text>swiper可滑动视图</text></view>
	</view>
	<view>
		<view class="smart-container"><text>2.基础内容</text></view>
		<view class="smart-panel-h" @click="goDetailPage('text')"><text>text文本编辑</text></view>
		<view class="smart-panel-h" @click="goDetailPage('icon')"><text>icon图标</text></view>
	</view>
	<view>
		<view class="smart-container"><text>3.表单组件</text></view>
		<view class="smart-panel-h" @click="goDetailPage('button')"><text>button按钮</text></view>
		<view class="smart-panel-h" @click="goDetailPage('checkbox')"><text>checkbox多选框</text></view>
		<view class="smart-panel-h" @click="goDetailPage('label')"><text>label标签组件</text></view>
		<view class="smart-panel-h" @click="goDetailPage('input')"><text>input输入框</text></view>
		<view class="smart-panel-h" @click="goDetailPage('textarea')"><text>textarea多行文本输入框</text></view>
		<view class="smart-panel-h" @click="goDetailPage('form')"><text>form表单</text></view>
	</view>
	<view>
		<view class="smart-container"><text>4.导航组件</text></view>
		<view class="smart-panel-h" @click="goDetailPage('navigator')"><text>navigator</text></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				account:null
			}
		},
		onShow(){
			console.log("组件页onShow");
			uni.getStorage({
				key:'Account',
				success(result){
					console.log("获取字段成功:"+result);
					this.account = result.data;
				},
				fail(errMsg){
					console.log("获取字段失败:"+JSON.stringify(errMsg));
				}
			})
		},
		methods: {
			goDetailPage(e) {
				if (typeof e === 'string') {
					uni.navigateTo({
						url: '/pages/components/' + e + '/' + e
					});
				} else {
					uni.navigateTo({
						url: e.url
					});
				}
			}
		}
	}
</script>

<style>

</style>